package com.force.common.mybatisplus.plusbase;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;

import lombok.*;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.Date;

/**
 * Entity基类
 *
 * @author ruoyi
 */
@Schema(title = "基类")
@Data
@ToString
@NoArgsConstructor
@MappedSuperclass
public class SnowBaseEntity implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** id */
    @Schema(title = "id")
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @GenericGenerator(name = "flakeId", strategy = "org.hibernate.id.SnowflakeGenerator")
    private Long id;

//
//    /** 创建时间 */
//    @Schema(title = "创建时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @TableField(value = "create_time", fill = FieldFill.INSERT)
//    @Column(name = "create_time",  columnDefinition = "datetime COMMENT '创建时间'")
//    private Date createTime;
//
//    /** 更新者 */
//    @Schema(title = "更新者id")
//    @TableField(fill = FieldFill.UPDATE,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "update_by_id",   columnDefinition = "bigint COMMENT '更新者id'")
//    private Long updateById;
//
//    /** 更新者 */
//    @Schema(title = "更新者name")
//    @TableField(fill = FieldFill.UPDATE,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "update_name",   columnDefinition = "bigint COMMENT '更新者name'")
//    private String updateName;
//
//    /** 更新者 */
//    @Schema(title = "更新者name")
//    @TableField(fill = FieldFill.UPDATE,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "update_by",   columnDefinition = "varchar(255) COMMENT '更新者name'")
//    private String updateBy;
//
//    /** 创建者 */
//    @Schema(title = "创建者")
//    @TableField(fill = FieldFill.INSERT,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "create_by_id",  columnDefinition = "bigint COMMENT '创建者id'")
//    private Long createById;
//
//    /** 创建者 */
//    @Schema(title = "创建者")
//    @TableField(fill = FieldFill.INSERT,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "create_name", columnDefinition = "varchar(255) COMMENT '创建者name'")
//    private String createName;
//
//    /** 创建者 */
//    @Schema(title = "创建者")
//    @TableField(fill = FieldFill.INSERT,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "create_by", columnDefinition = "varchar(255) COMMENT '创建者name'")
//    private String createBy;
//
//    /** 更新时间 */
//    @Schema(title = "更新时间")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
//    @Column(name = "update_time",  columnDefinition = "datetime COMMENT '更新时间'")
//    private Date updateTime;
//
//    /** 备注 */
//    @Schema(title = "备注")
//    @Column(name = "remark", length = 255,columnDefinition = "varchar(255) COMMENT '备注'")
//    private String remark;
//
//    /** 请求参数 */
//    @Schema(title = "请求参数")
//    @JsonInclude(JsonInclude.Include.NON_EMPTY)
//    @TableField(exist = false)
//    @Column(name = "params",  columnDefinition = "json COMMENT '请求参数'")
//    private String params;
//
//    @Schema(title = "逻辑删除")
//    @TableField(fill = FieldFill.INSERT,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "del_flag",  columnDefinition = "char COMMENT '逻辑删除'")
//    private Integer delFlag;
//
//    @Schema(title = "逻辑启用")
//    @TableField(fill = FieldFill.INSERT,updateStrategy = FieldStrategy.NOT_NULL)
//    @Column(name = "enable_flag",  columnDefinition = "char COMMENT '逻辑启用'")
//    private Integer enableFlag;

}
